package com.ruoyi.moon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.moon.mapper.MoonBackupsMapper;
import com.ruoyi.moon.domain.MoonBackups;
import com.ruoyi.moon.service.IMoonBackupsService;

/**
 * 备份Service业务层处理
 * 
 * @author admin
 * @date 2024-12-17
 */
@Service
public class MoonBackupsServiceImpl implements IMoonBackupsService 
{
    @Autowired
    private MoonBackupsMapper moonBackupsMapper;

    /**
     * 查询备份
     * 
     * @param id 备份主键
     * @return 备份
     */
    @Override
    public MoonBackups selectMoonBackupsById(Long id)
    {
        return moonBackupsMapper.selectMoonBackupsById(id);
    }

    /**
     * 查询备份列表
     * 
     * @param moonBackups 备份
     * @return 备份
     */
    @Override
    public List<MoonBackups> selectMoonBackupsList(MoonBackups moonBackups)
    {
        return moonBackupsMapper.selectMoonBackupsList(moonBackups);
    }

    /**
     * 新增备份
     * 
     * @param moonBackups 备份
     * @return 结果
     */
    @Override
    public int insertMoonBackups(MoonBackups moonBackups)
    {
        moonBackups.setCreateTime(DateUtils.getNowDate());
        return moonBackupsMapper.insertMoonBackups(moonBackups);
    }

    /**
     * 修改备份
     * 
     * @param moonBackups 备份
     * @return 结果
     */
    @Override
    public int updateMoonBackups(MoonBackups moonBackups)
    {
        return moonBackupsMapper.updateMoonBackups(moonBackups);
    }

    /**
     * 批量删除备份
     * 
     * @param ids 需要删除的备份主键
     * @return 结果
     */
    @Override
    public int deleteMoonBackupsByIds(Long[] ids)
    {
        return moonBackupsMapper.deleteMoonBackupsByIds(ids);
    }

    /**
     * 删除备份信息
     * 
     * @param id 备份主键
     * @return 结果
     */
    @Override
    public int deleteMoonBackupsById(Long id)
    {
        return moonBackupsMapper.deleteMoonBackupsById(id);
    }
}
